package com.grouppurchase.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("users")
@ApiModel("用户实体")
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ApiModelProperty("用户ID")
    private Long id;

    @ApiModelProperty("微信openid")
    private String openid;

    @ApiModelProperty("微信unionid")
    private String unionid;

    @ApiModelProperty("用户昵称")
    private String nickname;

    @ApiModelProperty("用户头像URL")
    private String avatar;

    @ApiModelProperty("手机号码")
    private String phone;

    @ApiModelProperty("角色：1普通用户，2管理员，3超级管理员")
    private Integer role;

    @ApiModelProperty("邀请码")
    private String inviteCode;

    @ApiModelProperty("邀请人ID")
    private Long inviterId;

    @ApiModelProperty("累计邀请人数")
    private Integer totalInvited;

    @ApiModelProperty("累计获得奖励（分）")
    private Integer totalReward;

    @ApiModelProperty("状态：1正常，0禁用")
    private Integer status;

    @ApiModelProperty("最后登录时间")
    private LocalDateTime lastLoginAt;
}
